/*
 *  Copyright 2012 Dirk Vranckaert
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package eu.vranckaert.vvl.model;

/**
 * User: DIRK VRANCKAERT
 * Date: 16/02/12
 * Time: 14:22
 */
public class TrafficInfoTextEnum {
    public static final String TEXT_IMAGE_URL = "http://www.verkeerscentrum.be/rss/%s-%s.xml";

    public enum InformationType {
        ACCIDENTS("INC", "ongevallen"),
        TRAFFIC_JAMS("LOS", "files"),
        TRAFFIC_INFO("INF", "wegeninfo"),
        ROAD_WORKS("PEVT", "werkzaamheden");

        private String value;
        private String rssValue;

        InformationType(String value, String rssValue) {
            this.value = value;
            this.rssValue = rssValue;
        }

        public String getValue() {
            return value;
        }

        public String getRssValue() {
            return rssValue;
        }

        public static InformationType getByValue(String value) {
            InformationType[] types = InformationType.values();
            for (InformationType type : types) {
                if (type.getValue().equals(value)) {
                    return type;
                }
            }
            return null;
        }

        public static InformationType getByRssValue(String rssValue) {
            InformationType[] types = InformationType.values();
            for (InformationType type : types) {
                if (type.getRssValue().equals(rssValue)) {
                    return type;
                }
            }
            return null;
        }
    }

    public enum Region {
        ANTWERPEN(1),
        KEMPEN(100),
        LEUVEN(101),
        LIMBURG(102),
        KORTRIJK(103),
        BRUSSEL(2),
        GENT(4),
        KUST(5);

        private int value;

        Region (int value) {
            this.value = value;
        }

        public int getValue() {
            return value;
        }

        public static Region getByValue(int value) {
            Region[] regions = Region.values();
            for (Region region : regions) {
                if (region.getValue() == value) {
                    return region;
                }
            }
            return null;
        }
    }

    public enum Highroad {
        Highroad_21(21),
        Highroad_78(78),
        Highroad_80(80),
        Highroad_82(82),
        Highroad_22(22),
        Highroad_83(83),
        Highroad_81(81),
        Highroad_79(79),
        Highroad_23(23),
        Highroad_24(24),
        Highroad_25(25),
        Highroad_26(26),
        Highroad_43(43),
        Highroad_56(56),
        Highroad_57(57),
        Highroad_31(31),
        Highroad_32(32),
        Highroad_33(33),
        Highroad_34(34),
        Highroad_30(30),
        Highroad_66(66),
        Highroad_67(67),
        Highroad_29(29),
        Highroad_68(68),
        Highroad_69(69),
        Highroad_27(27),
        Highroad_28(28),
        Highroad_44(44),
        Highroad_70(70),
        Highroad_71(71),
        Highroad_45(45),
        Highroad_73(73),
        Highroad_72(72),
        Highroad_51(51),
        Highroad_50(50),
        Highroad_46(46),
        Highroad_47(47),
        Highroad_39(39),
        Highroad_40(40),
        Highroad_38(38),
        Highroad_37(37),
        Highroad_48(48),
        Highroad_74(74),
        Highroad_75(75),
        Highroad_49(49),
        Highroad_76(76),
        Highroad_77(77),
        Highroad_36(36),
        Highroad_35(35),
        Highroad_62(62),
        Highroad_63(63),
        Highroad_58(58),
        Highroad_59(59),
        Highroad_52(52),
        Highroad_53(53),
        Highroad_64(64),
        Highroad_65(65),
        Highroad_42(42),
        Highroad_41(41),
        Highroad_60(60),
        Highroad_61(61),
        Highroad_54(54),
        Highroad_55(55);

        private int value;

        Highroad(int value) {
            this.value = value;
        }

        public int getValue() {
            return value;
        }

        public static Highroad getByValue(int value) {
            Highroad[] highroads = Highroad.values();
            for (Highroad highroad : highroads) {
                if (highroad.getValue() == value) {
                    return highroad;
                }
            }
            return null;
        }
    }

    public enum SecondaryRoads {
        SecondaryRoad_84(84),
        SecondaryRoad_85(85),
        SecondaryRoad_86(86),
        SecondaryRoad_87(87),
        SecondaryRoad_88(88),
        SecondaryRoad_89(89),
        SecondaryRoad_90(90),
        SecondaryRoad_91(91),
        SecondaryRoad_92(92),
        SecondaryRoad_93(93),
        SecondaryRoad_94(94),
        SecondaryRoad_95(95),
        SecondaryRoad_96(96),
        SecondaryRoad_97(97),
        SecondaryRoad_98(98),
        SecondaryRoad_99(99);

        private int value;

        SecondaryRoads (int value) {
            this.value = value;
        }

        public int getValue() {
            return value;
        }

        public static SecondaryRoads getByValue(int value) {
            SecondaryRoads[] secondaryRoads = SecondaryRoads.values();
            for (SecondaryRoads secondaryRoad : secondaryRoads) {
                if (secondaryRoad.getValue() == value) {
                    return secondaryRoad;
                }
            }
            return null;
        }
    }
}
